//
//  VideoModel.m
//  ParserXML
//
//  Created by 移云 on 2019/10/16.
//  Copyright © 2019 admin. All rights reserved.
//

#import "VideoModel.h"

@implementation VideoModel

- (instancetype)initWithDic:(NSDictionary *)dic
{
    if (self = [self init])
    {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+ (instancetype)videoModelWithDic:(NSDictionary *)dic
{
    return [[self alloc]initWithDic:dic];
}

- (NSString *)time
{
    int len = self.length.intValue;
    return [NSString stringWithFormat:@"%02d:%02d:%02d",len/3600,(len % 3600)/60,(len %60)];
}

- (NSString *)description
{
    return [NSString stringWithFormat:@"%@,{videoId: %@,name: %@,length: %@,videoURL: %@,imageURL: %@,desc: %@,teacher: %@}", [super description],self.videoId,self.name,self.length,self.videoURL,self.imageURL,self.desc,self.teacher];
}

@end
